const express = require('express')
const app = express()
const bodyParser = require('body-parser')
const path = require('path')
const fs = require('fs')
var https = require("https");
const httpsOption = {
    key: fs.readFileSync("./SSL/2889299_nj246.com.key"),
    cert: fs.readFileSync("./SSL/2889299_nj246.com.pem")
  }
app.use(bodyParser.json())
app.use(bodyParser.urlencoded({ extended: true }))
app.use(express.static(path.join(__dirname, 'public')));



require('./plugins/db')(app)
require('./routes/admin/login')(app)
require('./routes/admin/goodslist')(app)
require('./routes/admin/order')(app)
require('./routes/admin/address')(app)
require('./routes/admin/bill')(app)
require('./routes/web/goodslist')(app)
require('./routes/web/order')(app)
require('./routes/admin/pay')(app)
require('./routes/admin/admin')(app)
require('./routes/admin/admin1')(app)
require('./routes/admin/moneys')(app)

 https.createServer(httpsOption, app).listen(443);
app.listen(80, ()=>console.log("running 80..."))
